#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
int main()
{
	char arr[10001] = { '\0' };
	char key[10001] = { '\0' };
	gets(arr);
	gets(key);
	char* ptr = NULL;
	ptr = strpbrk(arr, key);
	while (ptr != NULL)
	{
		*ptr = '1';
		ptr = strpbrk(ptr + 1, key);
	}
	int i = 0;
	for (i = 0;i < strlen(arr);i++)
	{
		if (arr[i] != '1')
		{
			printf("%c", arr[i]);
		}
	}
	return 0;;
}